<div class="modal fade in" ng-controller="AddGroupNameCtrl">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" ng-click="close()"><span aria-hidden="true">&times;</span><span
                        class="sr-only">Close</span>
                </button>
                <h4 class="modal-title">阶段</h4>
            </div>
            <div class="modal-body">
                <form class="form-horizontal" name="groupForm">
                    <div class="form-group">
                        <label class="col-sm-2 control-label"><span class="required">*</span>名称</label>
                        <div class="col-sm-4">
                            <input type="input" ng-model="group.groupName" class="form-control" name="groupName"
                                  ng-change="isGroupNameRepeat()" ng-maxlength="50" placeholder="请输入名称，最多50位" required ng-change=""/>
                        </div>
                        <div class="col-sm-5">
                            <p class="form-control-static error"
                               ng-if="(groupForm.groupName.$error.maxlength) && groupForm.groupName.$touched && !groupForm.groupName.$error.required">
                                <i class="fu fu-cross-circle" aria-hidden="true">最多50位</i>
                            </p>
                            <p class="form-control-static error"
                               ng-if="groupForm.groupName.$error.required && groupForm.groupName.$touched">
                                <i class="fu fu-cross-circle" aria-hidden="true">不能为空</i>
                            </p>
                            <p class="form-control-static success"
                               ng-if="!groupNameRepeat && groupForm.groupName.$valid && groupForm.groupName.$touched">
                                <i class="fu fu-check-circle" aria-hidden="true"></i>
                            </p>
                            <p class="form-control-static error" ng-if="groupNameRepeat && !groupForm.groupName.$error.required && !groupForm.groupName.$error.maxlength">
                                <i class="fu fu-cross-circle small-i" aria-hidden="true"></i>该阶段名称已存在
                            </p>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-offset-2 col-sm-10">
                            <button type="submit" class="btn btn-primary" ng-click="save()"
                                    ng-disabled="groupForm.$invalid||groupNameRepeat">
                                确定
                            </button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>